package y23.Sep;

import java.util.Arrays;
import java.util.Scanner;

public class Test16 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n * 3];
        for (int i = 0; i < 3 * n; i++) {
            arr[i] = scanner.nextInt();
        }
        Arrays.sort(arr);
        int sum = 0;
        for (int i = 0; i < n; i++) {
            sum+=arr[arr.length-2*i-2];
        }
        System.out.println(sum);
    }
}
